import component from 'element-plus/es/components/tree-select/src/tree-select-option.mjs';

export const constantRoute = [{
    path: '/',
    //这种是懒加载，当用到这个路由的时候，才会加载这个组件
    component: () => import('@/views/layout/index.vue'),
    name: 'layout', //路由命名，路由鉴权需要使用到
    redirect: '/home',
    children: [{
        //进来/ 这个路径就来到了首页的组件
        path: '/home',
        //这种是懒加载，当用到这个路由的时候，才会加载这个组件
        component: () => import('@/views/home/index.vue'),
        name: '',
        children: [{
            path: '',
            component: () => import('@/views/home/components/homePage/index.vue'),
            name: 'content',
          },
          {
            path: '/home/post/:id',
            component: () => import('@/views/home/components/content/index.vue'),
            name: 'post',
          },
        ]
      },

      {
        path: '/postDetail/:id',
        component: () => import('@/views/postDetail/index.vue'),
        name: 'postDetail'
      },
      {
        path: '/message',
        component: () => import('@/views/message/index.vue'),
        name: 'message',
        redirect: '/message/comment',
        children: [{
            path: '/message/comment',
            component: () => import('@/views/message/components/comment.vue'),
            name: 'message-comment',
          },
          {
            path: '/message/additionalComment',
            component: () => import('@/views/message/components/additionalComment.vue'),
            name: 'message-additionalComment',
          },
          {
            path: '/message/fans',
            component: () => import('@/views/message/components/fans.vue'),
            name: 'message-fans',
          },
          {
            path: '/message/attention',
            component: () => import('@/views/message/components/attention.vue'),
            name: 'message-attention',
          },
          {
            path: '/message/collection',
            component: () => import('@/views/message/components/collection.vue'),
            name: 'message-collection',
          },
          {
            path: '/message/chat',
            component: () => import('@/views/message/components/chat.vue'),
            name: 'message-chat',
            children: [{
              path: '/message/chat/:receiveId',
              component: () => import('@/views/message/components/messageBox.vue'),
              name: 'message-chat-messageBox',
            }]
          },
          {
            path: '/message/notice',
            component: () => import('@/views/message/components/notice.vue'),
            name: 'message-notice',
          },
          {
            path: '/message/good',
            component: () => import('@/views/message/components/good.vue'),
            name: 'message-good',
          },
          {
            path: '/message/at',
            component: () => import('@/views/message/components/at.vue'),
            name: 'message-at',
          },
        ]
      },
      {
        path: '/publish',
        component: () => import('@/views/publish/index.vue'),
        name: 'publish',
      },
      {
        path: '/user/:userId',
        component: () => import('@/views/user/index.vue'),
        name: 'user',
      },
      {
        path: '/select/:queryString',
        component: () => import('@/views/select/index.vue'),
        name: 'select',
      },
      {
        path: '/history',
        component: () => import('@/views/history/index.vue'),
        name: 'history',
      },
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/login/index.vue'),
    name: 'login',
    redirect: '/login/passwordLogin',
    children: [{
        path: '/login/messageLogin',
        component: () => import('@/views/login/components/messageLogin.vue'),
        name: 'messageLogin',
      },
      {
        path: '/login/passwordLogin',
        component: () => import('@/views/login/components/passwordLogin.vue'),
        name: 'passwordLogin',
      },
      {
        path: '/login/register',
        component: () => import('@/views/login/components/register.vue'),
        name: 'register',
      },
      {
        path: '/login/forgetPassword',
        component: () => import('@/views/login/components/forgetPassword.vue'),
        name: 'forgetPassword',
      },
      {
        path: '/login/validation',
        component: () => import('@/views/login/components/validation.vue'),
        name: 'validation',
      },
      {
        path: '/login/resetPassword/:token',
        component: () => import('@/views/login/components/resetPassword.vue'),
        name: 'resetPassword',
      },
    ]
  },
  {
    path: '/:catchAll(.*)',
    component: () => import('@/views/404/index.vue'),
    name: '404',
  }

]